Imports System.Xml.Serialization

Public Class EntityKeyElement
    Inherits XEntityModelElementBase

    ''' <summary>Initializes an instance of the <see cref="EntityKeyElement" /> class.</summary>
    ''' <param name="namespace">The <see cref="XNamespace"/> of the new element.</param>
    Public Sub New(ByVal [namespace] As XNamespace)
        MyBase.New("Key", [namespace].ToString())
    End Sub

    ''' <summary>Initializes an instance of the <see cref="EntityKeyElement" /> class.</summary>
    ''' <param name="other">An <see cref="System.Xml.Linq.XElement"/> object to copy from.</param>
    Public Sub New(ByVal other As XElement)
        MyBase.New(other)
    End Sub

    Private __propertyRef As PropertyRefCollection

    <AutoLoad()> _
    <XmlElement("PropertyRef", GetType(PropertyRef))> _
    Public ReadOnly Property PropertyReferences() As PropertyRefCollection
        Get
            If (__propertyRef Is Nothing) Then
                __propertyRef = New EdmxEditor.PropertyRefCollection(Me, MyBase.Name.Namespace, "PropertyRef")
            End If
            Return __propertyRef
        End Get
    End Property

End Class
